<!-- Ranging of year -->
<template>
	<div class="ranking_list">
		<nav>
			<ul class="nav_li">
				<li v-for="(navli,index) of navList" :class="{cur:navli.iscur}" @click="navLiTab(navli,index)">{{navli.name}}</li>
			</ul>
		</nav>
		<team-list v-if="isTeamShow"></team-list>
		<country-list v-if="isCountryShow"></country-list>
		<before-rank v-if="isBeforeRankShow"></before-rank>
	</div>
</template>
<script type="text/javascript">
	import TeamList from './teamlist'
	import CountryList from './countrylist'
	import BeforeRank from './beforeRankList'

	import getInterface from '../../assets/js/insterface'

	export default{
		components:{
			TeamList,CountryList,BeforeRank
		},
		data(){
			return{
				// 'empNo':'zhanr0',
				// empNo:'panqb1',
				'navList':[
					{
						name:'团队',
						iscur:true
					},
					{
						name:'全国',
						iscur:false
					},
					{
						name:'历年排名',
						iscur:false
					}

				],
				'isTeamShow':true,
				'isCountryShow':false,
				'isBeforeRankShow':false,
				'teamRankUrl':getInterface.getTeamRankUrl + this.$route.query.empNo,
				'countryListRankUrl':getInterface.getCountryRankUrl + this.$route.query.empNo,
				'countryPageUpUrl':getInterface.getCountryRankUpUrl,
				'countryPageDownUrl':getInterface.getCountryRankDownUrl,
				'historyRankUrl':getInterface.getFindRankHistoryUrl + this.$route.query.empNo
			}
		},
		mounted(){
			document.title="个人绩效";
			this.$el.parentElement.parentNode.style.background = '#fafafa';

		},
		methods:{
			navLiTab(navli,index){

				for(let i=0; i<this.navList.length;i++){
					this.navList[i].iscur = false;
				};
				navli.iscur = true;
				// debugger;
				if(index == 0){
					this.isTeamShow = true;
					this.isCountryShow = false;
					this.isBeforeRankShow = false;
				}else if(index == 1){
					this.isTeamShow = false;
					this.isCountryShow = true;
					this.isBeforeRankShow = false;
				}else if(index == 2){
					this.isTeamShow = false;
					this.isCountryShow = false;
					this.isBeforeRankShow = true;
				}
			}
		}
	}
</script>
